import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, Validate } from 'class-validator';
import { IsNotExist } from 'src/utils/validators/is-not-exists.validator';

export class CreateCategoryDto {
	@ApiProperty({
		example: 'HTML',
		required: true,
		description: '分类名称',
	})
	@Validate(IsNotExist, ['Category'], {
		message: '该分类名称已存在',
	})
	@IsNotEmpty()
	categoryName: string;
}
